package test3;
//多态
class Shape{
    public void draw(){
      System.out.println("shape::draw()");

    }
}
class Rect extends Shape{
    @Override
    public void draw(){
        System.out.println("♦");
    }
}
class Flower extends Shape{
    @Override
    public void draw() {
        System.out.println("❀");
    }
}

public class Test3 {

    public static void drawMap(Shape shape){
        shape.draw();
    }

    public static void main(String[] args) {
        Rect rect=new Rect();
        drawMap(rect);
        Flower flower=new Flower();
        drawMap(flower);
    }

    public static void main1(String[] args) {
        Shape shape1 =new Rect();
        shape1.draw();
        Shape shape2 =new Flower();
        shape2.draw();
    }

}
